package com.toggery.POS.dao;

import com.toggery.POS.entity.Test;
import com.toggery.POS.entity.TestExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TestMapper {
    long countByExample(TestExample example);

    int deleteByExample(TestExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Test record);

    int insertSelective(Test record);

    List<Test> selectByExample(TestExample example);

    Test selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Test record, @Param("example") TestExample example);

    int updateByExample(@Param("record") Test record, @Param("example") TestExample example);

    int updateByPrimaryKeySelective(Test record);

    int updateByPrimaryKey(Test record);

    @Select({
            "select * from test where id=#{id,jdbcType=INTEGER}"
    })
    Test findById(Integer id);

    @Select({
            "select * from test"
    })
    List<Test> findAll();


    @Select({
            "select * from test where testname=#{name,jdbcType=VARCHAR} limit 1"
    })
    Test findByName(String name);

    @Select({
            "select * from test where testname like #{name,jdbcType=VARCHAR}"
    })
    List<Test> findLikeName(String name);
}